Vue.component('Detail', {
	template: `
		<el-dialog title="查看详情" width="600px" class="icon-dialog" :visible.sync="show" @open="open" :before-close="closeForm" append-to-body>
			<table cellpadding="0" cellspacing="0" class="table table-bordered" align="center" width="100%" style="word-break:break-all; margin-bottom:30px;  font-size:13px;">
				<tbody>
					<tr>
						<td class="title" width="100">meta_id：</td>
						<td>
							{{form.meta_id}}
						</td>
					</tr>
					<tr>
						<td class="title" width="100">姓名：</td>
						<td>
							{{form.name}}
						</td>
					</tr>
					<tr>
						<td class="title" width="100">形象：</td>
						<td>
							<span v-if="form.name">{{form.name}}</span>
						</td>
					</tr>
					<tr>
						<td class="title" width="100">语音合成方案：</td>
						<td>
							<span v-if="form.name">{{form.name}}</span>
						</td>
					</tr>
					<tr>
						<td class="title" width="100">语音识别方案：</td>
						<td>
							<span v-if="form.name">{{form.name}}</span>
						</td>
					</tr>
					<tr>
						<td class="title" width="100">语音模型方案：</td>
						<td>
							<span v-if="form.name">{{form.name}}</span>
						</td>
					</tr>
					<tr>
						<td class="title" width="100">角色id：</td>
						<td>
							{{form.role_id}}
						</td>
					</tr>
					<tr>
						<td class="title" width="100">链接：</td>
						<td>
						<el-link v-if="form.url" style="font-size:13px;" :href="form.url" target="_blank">{{form.url}}</el-link>
						</td>
					</tr>
					<tr>
						<td class="title" width="100">状态：</td>
						<td>
							<span v-if="form.status == '1'">开启</span>
							<span v-if="form.status == '2'">关闭</span>
						</td>
					</tr>
					<tr>
						<td class="title" width="100">头像：</td>
						<td>
							<el-image v-if="form.avatar" class="table_list_pic" :src="form.avatar"  :preview-src-list="[form.avatar]"></el-image>
						</td>
					</tr>
					<tr>
						<td class="title" width="100">详细信息：</td>
						<td>
							<div v-html="form.basicInformation"></div>
						</td>
					</tr>
					<tr>
						<td class="title" width="100">开场白：</td>
						<td>
							{{form.openingLine}}
						</td>
					</tr>
					<tr>
						<td class="title" width="100">强制要求：</td>
						<td>
							{{form.traits}}
						</td>
					</tr>
					<tr>
						<td class="title" width="100">创建时间：</td>
						<td>
							{{parseTime(form.create_time)}}
						</td>
					</tr>
					<tr>
						<td class="title" width="100">更新时间：</td>
						<td>
							{{parseTime(form.updatetime)}}
						</td>
					</tr>
				</tbody>
			</table>
		</el-dialog>
	`
	,
	props: {
		show: {
			type: Boolean,
			default: true
		},
		size: {
			type: String,
			default: 'mini'
		},
		info: {
			type: Object,
		},
	},
	data() {
		return {
			form:{
			},
		}
	},
	methods: {
		open(){
			axios.post(base_url+'/Meta/Web/detail',this.info).then(res => {
				this.form = res.data.data
			})
		},
		closeForm(){
			this.$emit('update:show', false)
		}
	}
})
